<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>arrayment</title>
    <script>
        var marks = [3,6,81,4,0,7];
        
        document.write("原始数据</br>");  
        document.write(marks);
        
        document.write("</br>");
        
       function Array(marks)
       {
        for(var i=0;i<=marks.length - 1; i++){
            for(var j = 0;j <= marks.length - 1 - i; j++){
                if(marks[j]>marks[j + 1]) {
                    var temp =marks[j];
                    marks[j]=marks[j+1];
                    marks[j + 1]=temp;
                }
            }
        }
        //return marks;
       } 
        document.write("</br>排序之后的数据</br>");
        console.log(Array(marks))
        // Print Srted Numeric Array  
        document.write(marks);  
        </script>
        
        
        
    
